home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 February
/
EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso
/
earcd
/
util1
/
vmmstat.lha
/
VMMStat
/
RCS
/
VMM_Stat.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-07-25
|
3KB
|
130 lines
head 1.1;
access;
symbols;
locks; strict;
comment @ * @;
1.1
date 95.07.25.11.33.38; author enderle; state Exp;
branches;
next ;
desc
@VMM standard header file
@
1.1
log
@Initial revision
@
text
@#ifndef VMM_STAT_H
#define VMM_STAT_H
#include <exec/types.h>
#include <exec/tasks.h>
#include <exec/ports.h>
/**********************************************************************/
/* Getting statistics messages from VMM for further processing */
/**********************************************************************/
struct VMStatMsg
{
struct Message VMMessage; /* don't forget to put sizeof (struct VMStatMsg) */
/* into mn_Length. Future version of VMM might */
/* extend this structure */
struct Task *Sender;
UWORD Command;
UWORD ReplySignal;
ULONG VMSize;
ULONG VMFree;
ULONG Faults;
ULONG PagesWritten;
ULONG PagesRead;
ULONG NumFrames;
ULONG PagesUsed;
ULONG PageSize;
ULONG TrapStructsFree;
};
#define VMCMD_AskStat 1472
/* Do the following to get a statistics message from VMM:
*
* struct VMStatMsg *StatMsg;
* LONG VMSignal;
* struct MsgPort *VMPort;
*
* if ((StatMsg = AllocMem (sizeof (struct VMStatMsg), MEMF_PUBLIC)) == NULL)
* Cleanup ();
*
* if ((VMSignal = AllocSignal (-1L)) == -1L)
* Cleanup ();
*
* StatMsg->VMMessage.mn_Length = sizeof (struct VMStatMsg);
* StatMsg->Sender = FindTask (NULL);
* StatMsg->Command = VMCMD_AskStat;
* StatMsg->ReplySignal = VMSignal;
*
* Forbid ();
* if ((VMPort = FindPort ("VMM_Port")) != NULL)
* PutMsg (VMPort, (struct Message*)StatMsg);
* else
* ....
*
* Permit ();
*
* Wait (1L << VMSignal);
*
* When this returns the StatMsg will contain the necessary parameters.
* Do whatever you like with it.
*
* Cleanup ();
*
* Easy, isn't it?
*/
/**********************************************************************/
/* Getting VM usage statistics from VMM */
/**********************************************************************/
/* Send the following message structure to 'VMM_Port' just as a few lines
* above.
*/
struct VMUsageMsg
{
struct Message VMMessage; /* don't forget to put sizeof (struct VMStatMsg) */
/* into mn_Length. Future version of VMM might */
/* extend this structure */
struct Task *Sender;
UWORD Command;
UWORD ReplySignal;
struct List *TaskList;
};
/* Use this for the Command value */
#define VMCMD_AskVMUsage 1481
/* As soon as this returns, 'TaskList' will have been filled in.
* 'TaskList' is a list of 'struct TaskVMUsage' described below.
* You can do whatever you like with the list, but as soon as you are
* finished you should call FreeMem for every 'struct TaskVMUsage'
* with a size of 'FreeSize' and for the List structure.
*/
struct TaskVMUsage
{
struct Node vu_Node;
LONG VMInUse;
ULONG FreeSize;
};
#endif
@